package com.hucheng.order.vo;

import com.hucheng.order.entity.BalanceGoodsDO;
import com.hucheng.order.entity.OrderInfoDO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.time.format.DateTimeFormatter;

/**
 * @Author: 凉白开不加冰
 * @Version: 0.0.1V
 * @Date: 2019-07-18
 * @Description: 类描述
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BalanceGoodsVo implements Serializable{
    private Integer userId;
    private Integer goodsId;
    private String goodsName;
    private Integer goodsNumber;
    private BigDecimal goodsPrice;

    public static BalanceGoodsVo buildBalanceGoodsVo(final BalanceGoodsDO balanceGoodsDO) {
        if (balanceGoodsDO == null) {
            return null;
        }
        return new BalanceGoodsVo(balanceGoodsDO.getUserId(),balanceGoodsDO.getGoodsId(),balanceGoodsDO.getGoodsName(),balanceGoodsDO.getGoodsNumber()
        ,balanceGoodsDO.getGoodsPrice());
    }
}
